VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmMaintAccount 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   7440
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   9690
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   7440
   ScaleWidth      =   9690
   ShowInTaskbar   =   0   'False
   Begin VB.PictureBox ReportIcon 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   210
      Left            =   9165
      Picture         =   "frmMaintAccount.frx":0000
      ScaleHeight     =   210
      ScaleWidth      =   300
      TabIndex        =   60
      Top             =   1035
      Width           =   300
   End
   Begin ITGControls.ITGTab SSTab1 
      Height          =   6090
      Left            =   0
      TabIndex        =   46
      Top             =   1005
      Width           =   9525
      _ExtentX        =   16801
      _ExtentY        =   10742
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   2
      Tab(0)ContCtrlCap(1)=   "SSTab2"
      Tab(0)ContCtrlCap(2)=   "ComunionFrames1"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabCaption(2)   =   "               Explorer               "
      TabContCtrlCnt(2)=   3
      Tab(2)ContCtrlCap(1)=   "TreeView1"
      Tab(2)ContCtrlCap(2)=   "ListView1"
      Tab(2)ContCtrlCap(3)=   "ilMain"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483630
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   5775
         Left            =   -75000
         TabIndex        =   44
         Top             =   315
         Width           =   9525
         _ExtentX        =   16801
         _ExtentY        =   10186
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   4
         BeginProperty Column00 
            DataField       =   "cAcctNo"
            Caption         =   "Account ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cTitle"
            Caption         =   "Account Title"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cCategory"
            Caption         =   "Category"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cType"
            Caption         =   "Type"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1440
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   4515.024
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
            EndProperty
            BeginProperty Column03 
            EndProperty
         EndProperty
      End
      Begin MSComctlLib.TreeView TreeView1 
         Height          =   5625
         Left            =   -74940
         TabIndex        =   45
         Top             =   390
         Width           =   3615
         _ExtentX        =   6376
         _ExtentY        =   9922
         _Version        =   393217
         Indentation     =   529
         LineStyle       =   1
         Style           =   7
         ImageList       =   "ilMain"
         Appearance      =   1
      End
      Begin MSComctlLib.ListView ListView1 
         Height          =   5655
         Left            =   -71310
         TabIndex        =   55
         Top             =   375
         Width           =   5775
         _ExtentX        =   10186
         _ExtentY        =   9975
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         _Version        =   393217
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   0
      End
      Begin MSComctlLib.ImageList ilMain 
         Left            =   -73935
         Top             =   1425
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   16
         ImageHeight     =   16
         MaskColor       =   16711935
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   3
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmMaintAccount.frx":05C2
               Key             =   "fldrClosed"
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmMaintAccount.frx":0B5C
               Key             =   "fldrOpen"
            EndProperty
            BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmMaintAccount.frx":10F6
               Key             =   "AcctIcon"
            EndProperty
         EndProperty
      End
      Begin ITGControls.ITGTab SSTab2 
         Height          =   2880
         Left            =   0
         TabIndex        =   49
         Top             =   3210
         Width           =   9525
         _ExtentX        =   16801
         _ExtentY        =   5080
         TabCount        =   4
         TabCaption(0)   =   "     Basic     "
         TabContCtrlCnt(0)=   2
         Tab(0)ContCtrlCap(1)=   "Frame4"
         Tab(0)ContCtrlCap(2)=   "Frame5"
         TabCaption(1)   =   "     Current Year     "
         TabContCtrlCnt(1)=   12
         Tab(1)ContCtrlCap(1)=   "txtPeriod11"
         Tab(1)ContCtrlCap(2)=   "txtPeriod12"
         Tab(1)ContCtrlCap(3)=   "txtPeriod10"
         Tab(1)ContCtrlCap(4)=   "txtPeriod9"
         Tab(1)ContCtrlCap(5)=   "txtPeriod7"
         Tab(1)ContCtrlCap(6)=   "txtPeriod8"
         Tab(1)ContCtrlCap(7)=   "txtPeriod6"
         Tab(1)ContCtrlCap(8)=   "txtPeriod5"
         Tab(1)ContCtrlCap(9)=   "txtPeriod3"
         Tab(1)ContCtrlCap(10)=   "txtPeriod4"
         Tab(1)ContCtrlCap(11)=   "txtPeriod2"
         Tab(1)ContCtrlCap(12)=   "txtPeriod1"
         TabCaption(2)   =   "     Budget     "
         TabContCtrlCnt(2)=   1
         Tab(2)ContCtrlCap(1)=   "dtgBudget"
         TabCaption(3)   =   "     History     "
         TabContCtrlCnt(3)=   3
         Tab(3)ContCtrlCap(1)=   "dtgTransRange"
         Tab(3)ContCtrlCap(2)=   "ITGCommandButton6"
         Tab(3)ContCtrlCap(3)=   "Frame2"
         TabTheme        =   2
         ActiveTabBackStartColor=   16250865
         ActiveTabBackEndColor=   16243138
         InActiveTabBackStartColor=   16243138
         InActiveTabBackEndColor=   16243138
         BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         OuterBorderColor=   4210752
         TopLeftInnerBorderColor=   4210752
         BottomRightInnerBorderColor=   4210752
         DisabledTabBackColor=   16243138
         DisabledTabForeColor=   -2147483630
         Begin MSDataGridLib.DataGrid dtgTransRange 
            Height          =   2565
            Left            =   -72720
            TabIndex        =   43
            Top             =   315
            Width           =   7245
            _ExtentX        =   12779
            _ExtentY        =   4524
            _Version        =   393216
            HeadLines       =   1
            RowHeight       =   15
            FormatLocked    =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   4
            BeginProperty Column00 
               DataField       =   ""
               Caption         =   "Date"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   ""
               Caption         =   "Trans. #"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   ""
               Caption         =   "Debit"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   ""
               Caption         =   "Credit"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  ColumnWidth     =   1365.165
               EndProperty
               BeginProperty Column01 
                  ColumnWidth     =   1454.74
               EndProperty
               BeginProperty Column02 
                  ColumnWidth     =   1590.236
               EndProperty
               BeginProperty Column03 
                  ColumnWidth     =   1590.236
               EndProperty
            EndProperty
         End
         Begin ITGControls.ITGCommandButton ITGCommandButton6 
            Height          =   360
            Left            =   -74910
            TabIndex        =   42
            Top             =   1695
            Width           =   2115
            _ExtentX        =   3731
            _ExtentY        =   635
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Caption         =   "Show History"
         End
         Begin VB.Frame Frame2 
            Appearance      =   0  'Flat
            BackColor       =   &H00F7D9C2&
            Caption         =   " Date Range "
            ForeColor       =   &H80000008&
            Height          =   1260
            Left            =   -74910
            TabIndex        =   57
            Top             =   375
            Width           =   2115
            Begin ITGControls.ITGDateBox ITGDateBox2 
               Height          =   285
               Left            =   675
               TabIndex        =   41
               Top             =   705
               Width           =   1260
               _ExtentX        =   2223
               _ExtentY        =   503
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   ""
               SendKeysTab     =   -1  'True
            End
            Begin ITGControls.ITGDateBox ITGDateBox1 
               Height          =   285
               Left            =   675
               TabIndex        =   40
               Top             =   390
               Width           =   1260
               _ExtentX        =   2223
               _ExtentY        =   503
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   ""
               SendKeysTab     =   -1  'True
            End
            Begin VB.Label Label2 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "To"
               Height          =   195
               Left            =   195
               TabIndex        =   59
               Top             =   735
               Width           =   180
            End
            Begin VB.Label Label1 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "From"
               Height          =   195
               Left            =   195
               TabIndex        =   58
               Top             =   450
               Width           =   360
            End
         End
         Begin MSDataGridLib.DataGrid dtgBudget 
            Height          =   2565
            Left            =   -75000
            TabIndex        =   39
            Top             =   315
            Width           =   9525
            _ExtentX        =   16801
            _ExtentY        =   4524
            _Version        =   393216
            HeadLines       =   1
            RowHeight       =   15
            FormatLocked    =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   8
            BeginProperty Column00 
               DataField       =   "cRange"
               Caption         =   "Range"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "dFrom"
               Caption         =   "Date From"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "M/d/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "dTo"
               Caption         =   "Date To"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "M/d/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "nBudget"
               Caption         =   "Budget"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "lFixed"
               Caption         =   "Fixed"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   5
                  Format          =   ""
                  HaveTrueFalseNull=   1
                  TrueValue       =   "Yes"
                  FalseValue      =   "No"
                  NullValue       =   ""
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   7
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "lAccrued"
               Caption         =   "Accrued"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   5
                  Format          =   ""
                  HaveTrueFalseNull=   1
                  TrueValue       =   "Yes"
                  FalseValue      =   "No"
                  NullValue       =   ""
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   7
               EndProperty
            EndProperty
            BeginProperty Column06 
               DataField       =   ""
               Caption         =   "Alert on Voucher"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column07 
               DataField       =   ""
               Caption         =   "Type"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  ColumnWidth     =   1124.787
               EndProperty
               BeginProperty Column01 
                  ColumnWidth     =   1244.976
               EndProperty
               BeginProperty Column02 
                  ColumnWidth     =   1230.236
               EndProperty
               BeginProperty Column03 
                  Alignment       =   1
                  ColumnWidth     =   1649.764
               EndProperty
               BeginProperty Column04 
                  Alignment       =   2
                  ColumnWidth     =   1244.976
               EndProperty
               BeginProperty Column05 
                  Alignment       =   2
                  ColumnWidth     =   1260.284
               EndProperty
               BeginProperty Column06 
               EndProperty
               BeginProperty Column07 
               EndProperty
            EndProperty
         End
         Begin ITGControls.ITGTextBox txtPeriod11 
            Height          =   285
            Left            =   -68580
            TabIndex        =   37
            Top             =   1290
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 11"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod12 
            Height          =   285
            Left            =   -68580
            TabIndex        =   38
            Top             =   1605
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 12"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod10 
            Height          =   285
            Left            =   -68580
            TabIndex        =   36
            Top             =   975
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 10"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod9 
            Height          =   285
            Left            =   -68580
            TabIndex        =   35
            Top             =   660
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 9"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod7 
            Height          =   285
            Left            =   -71520
            TabIndex        =   33
            Top             =   1290
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 7"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod8 
            Height          =   285
            Left            =   -71520
            TabIndex        =   34
            Top             =   1605
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 8"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod6 
            Height          =   285
            Left            =   -71520
            TabIndex        =   32
            Top             =   975
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 6"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod5 
            Height          =   285
            Left            =   -71520
            TabIndex        =   31
            Top             =   660
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 5"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod3 
            Height          =   285
            Left            =   -74505
            TabIndex        =   29
            Top             =   1290
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 3"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod4 
            Height          =   285
            Left            =   -74505
            TabIndex        =   30
            Top             =   1605
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 4"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod2 
            Height          =   285
            Left            =   -74505
            TabIndex        =   28
            Top             =   975
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 2"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPeriod1 
            Height          =   285
            Left            =   -74505
            TabIndex        =   27
            Top             =   660
            Width           =   2430
            _ExtentX        =   4075
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            MaximumValue    =   9999999999.99
            DecimalPlace    =   2
            Label           =   "Period 1"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1000
            TextBoxWidth    =   1370
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin VB.Frame Frame4 
            BackColor       =   &H00F7D9C2&
            Height          =   1875
            Left            =   6240
            TabIndex        =   56
            Top             =   495
            Width           =   2820
            Begin ITGControls.ITGTextBox txtInitial 
               Height          =   285
               Left            =   165
               TabIndex        =   23
               Top             =   300
               Width           =   2430
               _ExtentX        =   4075
               _ExtentY        =   503
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               MaximumValue    =   9999999999.99
               DecimalPlace    =   2
               Label           =   "Beginning"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1000
               TextBoxWidth    =   1370
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtDebit 
               Height          =   285
               Left            =   165
               TabIndex        =   24
               Top             =   615
               Width           =   2430
               _ExtentX        =   4075
               _ExtentY        =   503
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               MaximumValue    =   9999999999.99
               DecimalPlace    =   2
               Label           =   "Debit"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1000
               TextBoxWidth    =   1370
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtBalance 
               Height          =   285
               Left            =   165
               TabIndex        =   26
               Top             =   1245
               Width           =   2430
               _ExtentX        =   4075
               _ExtentY        =   503
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               MaximumValue    =   9999999999.99
               DecimalPlace    =   2
               Label           =   "Ending"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1000
               TextBoxWidth    =   1370
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtCredit 
               Height          =   285
               Left            =   165
               TabIndex        =   25
               Top             =   930
               Width           =   2430
               _ExtentX        =   4075
               _ExtentY        =   503
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               MaximumValue    =   9999999999.99
               DecimalPlace    =   2
               Label           =   "Credit"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1000
               TextBoxWidth    =   1370
               Enabled         =   0   'False
            End
         End
         Begin VB.Frame Frame5 
            BackColor       =   &H00F7D9C2&
            Height          =   1890
            Left            =   285
            TabIndex        =   53
            Top             =   495
            Width           =   5880
            Begin VB.CommandButton cmdPickRef 
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   270
               Left            =   2490
               Picture         =   "frmMaintAccount.frx":2148
               Style           =   1  'Graphical
               TabIndex        =   21
               Top             =   1290
               Width           =   315
            End
            Begin VB.CommandButton cmdPickDepartment 
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   300
               Left            =   2490
               Picture         =   "frmMaintAccount.frx":2292
               Style           =   1  'Graphical
               TabIndex        =   14
               Top             =   300
               Width           =   315
            End
            Begin VB.CommandButton cmdPickCenter 
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   300
               Left            =   2490
               Picture         =   "frmMaintAccount.frx":23DC
               Style           =   1  'Graphical
               TabIndex        =   17
               Top             =   615
               Width           =   315
            End
            Begin VB.ComboBox cboRefType 
               Height          =   315
               ItemData        =   "frmMaintAccount.frx":2526
               Left            =   1380
               List            =   "frmMaintAccount.frx":2539
               Style           =   2  'Dropdown List
               TabIndex        =   19
               Top             =   930
               Width           =   1440
            End
            Begin ITGControls.ITGTextBox txtRefName 
               Height          =   285
               Left            =   2820
               TabIndex        =   22
               Top             =   1275
               Width           =   2925
               _ExtentX        =   5054
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               Locked          =   -1  'True
               Label           =   "ITGtext"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   0
               TextBoxWidth    =   2865
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtReference 
               Height          =   285
               Left            =   105
               TabIndex        =   20
               Tag             =   "C"
               Top             =   1275
               Width           =   2355
               _ExtentX        =   3942
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14745599
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               MaxLength       =   12
               Mandatory       =   -1  'True
               Label           =   "Reference"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1250
               TextBoxWidth    =   1045
            End
            Begin ITGControls.ITGTextBox txtDeptName 
               Height          =   285
               Left            =   2820
               TabIndex        =   15
               Top             =   300
               Width           =   2925
               _ExtentX        =   5054
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               Locked          =   -1  'True
               Label           =   "ITGtext"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   0
               TextBoxWidth    =   2865
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtDepartment 
               Height          =   285
               Left            =   105
               TabIndex        =   13
               Tag             =   "C"
               Top             =   300
               Width           =   2340
               _ExtentX        =   3916
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14745599
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               MaxLength       =   12
               Mandatory       =   -1  'True
               Label           =   "Department"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1250
               TextBoxWidth    =   1030
            End
            Begin ITGControls.ITGTextBox txtCenterName 
               Height          =   285
               Left            =   2820
               TabIndex        =   18
               Top             =   615
               Width           =   2925
               _ExtentX        =   5054
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14737632
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               Locked          =   -1  'True
               Label           =   "ITGtext"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   0
               TextBoxWidth    =   2865
               Enabled         =   0   'False
            End
            Begin ITGControls.ITGTextBox txtCenter 
               Height          =   285
               Left            =   105
               TabIndex        =   16
               Tag             =   "C"
               Top             =   615
               Width           =   2340
               _ExtentX        =   3916
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               BackColor       =   14745599
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               AllCaps         =   -1  'True
               MaxLength       =   12
               Mandatory       =   -1  'True
               Label           =   "Cost Center"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1250
               TextBoxWidth    =   1030
            End
            Begin ITGControls.ITGTextBox txtRefType 
               Height          =   285
               Left            =   120
               TabIndex        =   54
               Tag             =   "cboType"
               Top             =   930
               Width           =   2010
               _ExtentX        =   3334
               _ExtentY        =   503
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Mandatory       =   -1  'True
               Label           =   "Ref. Type"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               LabelWidth      =   1280
               TextBoxWidth    =   670
            End
         End
      End
      Begin ITGControls.ComunionFrames ComunionFrames1 
         Height          =   2895
         Left            =   0
         Top             =   315
         Width           =   9525
         _ExtentX        =   16801
         _ExtentY        =   5106
         FrameColor      =   4210752
         BackColor       =   16243138
         FillColor       =   16243138
         RoundedCorner   =   0   'False
         Caption         =   "Information"
         Alignment       =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ThemeColor      =   5
         ColorFrom       =   16243138
         ColorTo         =   16250865
         Begin VB.Timer Timer1 
            Interval        =   300
            Left            =   3045
            Top             =   465
         End
         Begin VB.ComboBox cboCategory 
            Height          =   315
            ItemData        =   "frmMaintAccount.frx":2567
            Left            =   1545
            List            =   "frmMaintAccount.frx":2569
            Style           =   2  'Dropdown List
            TabIndex        =   3
            Top             =   1125
            Width           =   1800
         End
         Begin VB.CommandButton cmdPickGA 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   3390
            Picture         =   "frmMaintAccount.frx":256B
            Style           =   1  'Graphical
            TabIndex        =   6
            Top             =   1470
            Width           =   315
         End
         Begin VB.ComboBox cboType 
            Height          =   315
            ItemData        =   "frmMaintAccount.frx":26B5
            Left            =   1545
            List            =   "frmMaintAccount.frx":26B7
            Style           =   2  'Dropdown List
            TabIndex        =   8
            Top             =   1755
            Width           =   1800
         End
         Begin VB.ComboBox cboClass 
            Height          =   315
            ItemData        =   "frmMaintAccount.frx":26B9
            Left            =   7470
            List            =   "frmMaintAccount.frx":26C3
            Style           =   2  'Dropdown List
            TabIndex        =   4
            Top             =   1140
            Width           =   1890
         End
         Begin VB.CommandButton cmdPickUnitDiv 
            Height          =   300
            Left            =   3390
            Picture         =   "frmMaintAccount.frx":26D8
            Style           =   1  'Graphical
            TabIndex        =   11
            Top             =   2085
            Width           =   315
         End
         Begin ITGControls.ITGTextBox txtAcctNo 
            Height          =   285
            Left            =   225
            TabIndex        =   1
            Top             =   525
            Width           =   2745
            _ExtentX        =   4630
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            MaxLength       =   15
            Mandatory       =   -1  'True
            Label           =   "Account ID"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1405
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtTitle 
            Height          =   285
            Left            =   225
            TabIndex        =   2
            Top             =   825
            Width           =   9120
            _ExtentX        =   15875
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Account Title"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   7780
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtLevel 
            Height          =   285
            Left            =   7605
            TabIndex        =   9
            Top             =   1785
            Width           =   1755
            _ExtentX        =   2884
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            AllCaps         =   -1  'True
            DataType        =   1
            Mandatory       =   -1  'True
            Label           =   "Level"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   800
            TextBoxWidth    =   895
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtGeneral 
            Height          =   285
            Left            =   225
            TabIndex        =   5
            Top             =   1455
            Width           =   3135
            _ExtentX        =   5318
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "General"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1795
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtGeneralDesc 
            Height          =   285
            Left            =   3705
            TabIndex        =   7
            Top             =   1470
            Width           =   5655
            _ExtentX        =   9869
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   5595
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtClass 
            Height          =   285
            Left            =   6720
            TabIndex        =   50
            Tag             =   "cboType"
            Top             =   1140
            Width           =   2235
            _ExtentX        =   3731
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Class"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   800
            TextBoxWidth    =   1375
            Required        =   -1  'True
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtCategory 
            Height          =   285
            Left            =   225
            TabIndex        =   51
            Tag             =   "cboCategory"
            Top             =   1140
            Width           =   2790
            _ExtentX        =   4710
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Category"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1450
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtType 
            Height          =   285
            Left            =   240
            TabIndex        =   52
            Tag             =   "cboType"
            Top             =   1740
            Width           =   2820
            _ExtentX        =   4763
            _ExtentY        =   503
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Type"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1480
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtUnitDivDesc 
            Height          =   285
            Left            =   3705
            TabIndex        =   12
            Top             =   2085
            Width           =   5655
            _ExtentX        =   9869
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   ""
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   5595
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtUnitDiv 
            Height          =   285
            Left            =   240
            TabIndex        =   10
            Top             =   2100
            Width           =   3120
            _ExtentX        =   5292
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Unit Department"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1780
         End
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   0
      Top             =   7185
      Width           =   9690
      _ExtentX        =   17092
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin VB.Label lblDetails 
      BackColor       =   &H00F7D9C2&
      Caption         =   "Category"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   48
      Top             =   525
      Width           =   7560
   End
   Begin VB.Label lblHeader 
      BackColor       =   &H00F7D9C2&
      Caption         =   "Account ID - Account Title"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   375
      Left            =   120
      TabIndex        =   47
      Top             =   165
      Width           =   7440
   End
   Begin VB.Image imgLogo 
      BorderStyle     =   1  'Fixed Single
      Height          =   930
      Left            =   8370
      Stretch         =   -1  'True
      Top             =   0
      Width           =   1125
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H00404040&
      Height          =   960
      Left            =   0
      Top             =   0
      Width           =   8265
   End
End
Attribute VB_Name = "frmMaintAccount"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

'Object variables






'Recordset variables
Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1
Private rsBudget As ADODB.Recordset
Private rsAccountBalance As ADODB.Recordset

'ADO Connection variables

Private connHeader As ADODB.Connection
Private connBudget As ADODB.Connection
Private connList As ADODB.Connection

'Form mode enumeration
Public Enum eCOAMode
    Normal
    AddNewEdit
    Find
End Enum
Private Mode As eCOAMode

'Other declaration
Private bNewTrans  As Boolean
Private bEditTrans As Boolean
Private bDelTrans As Boolean

Public dtgName As String
Public sBit As String
Private vBM As Variant 'Recordset bookmark variable

'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cboCategory_Click()
    txtCategory = Trim(cboCategory)
End Sub

Private Sub cboCategory_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub cboClass_Click()
    txtClass = Trim(cboClass)
End Sub

Private Sub cboClass_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub cboType_Click()
    txtType = Trim(cboType)
End Sub

Private Sub cboType_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub cmdPickGA_Click()
    If Trim(cboCategory) = "" Then
        MsgBox "Please select account category.", vbInformation, "ComUnion"
        txtGeneral = ""
        cboCategory.SetFocus
        Exit Sub
    End If
    If lPickListActive Then Exit Sub
    RepName = Trim(cboCategory)
    frmITGPickList.mType = Accounts_General
    frmITGPickList.Show vbModal
    txtGeneral = frmITGPickList.mCode
    txtGeneralDesc = frmITGPickList.mName
    txtLevel = CDbl(frmITGPickList.mQty) + 1
    If Trim(txtGeneralDesc) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub cmdPickUnitDiv_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtUnitDiv)
    frmITGPicker.zType = QProfitCenter
    frmITGPicker.Show vbModal
    txtUnitDiv = frmITGPicker.zCode
    txtUnitDivDesc = frmITGPicker.zName
    If Trim(txtUnitDivDesc) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub dtgBudget_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 1
            'If GetValueFrTable("cBankID", "BANK", "cBankID = '" & Trim(dtgPayment.Columns(1).Text) & "'") <> "" Then
            '    dtgPayment.Col = 2
            '    dtgPayment.Columns(2).Value = rsPayment!cCheckNo
            'End If
        Case 2
            'If Trim(rsPayment!cType) = "CSH" Then Exit Sub
            'If Trim(rsPayment!cType) = "OFF" Then Exit Sub
            'If Trim(dtgPayment.Columns(1).Text) = "" Then
            '    MsgBox "BANK is required."
            '    dtgPayment.Columns(2).Value = rsPayment!cBankID
            '    dtgPayment.Col = 1
            '    dtgPayment.Columns(1).Value = rsPayment!cBankID
            '    Exit Sub
            'End If
            'If CheckExisting(rsPayment!cCheckNo, rsPayment!cBankID, rsHeader!cTranno, rsPayment, True) Then
            '    MsgBox "Check already exist."
            '    Exit Sub
            'End If
        Case 4
            'TotalPaymentAmount
            'ToApplyAmount
    End Select
End Sub

Private Sub dtgBudget_Click()
    If Mode = AddNewEdit Then dtgName = dtgBudget.Name
End Sub

Private Sub dtgBudget_GotFocus()
    dtgName = dtgBudget.Name
End Sub

Private Sub dtgBudget_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgBudget_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If rsBudget.RecordCount = 0 Then Exit Sub
    
    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
    
    If KeyAscii = 13 Then
        Select Case dtgBudget.Col
            Case 0
                'If Not cboPR_C.Visible Then dtgPayment_ButtonClick 0
                SendKeys "{Tab}"
            Case 1
                'If GetValueFrTable("cBankID", "BANK", "cBankID = '" & Trim(dtgPayment.Columns(1).Text) & "'") = "" Then
                '    If Trim(dtgPayment.Columns(0).Text) = "CSH" Then
                '        SendKeys "{Tab}"
                '        SendKeys "{Tab}"
                '        dtgPayment.Columns(3).Text = Format(Date, "MM/dd/yyyy")
                '    Else
                '        dtgPayment_ButtonClick (1) 'use button click
                '    End If
                'End If
            Case 5
                TBNewLine
                dtgBudget.LeftCol = 0
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        'KeyAscii = Asc(UCase(Chr(KeyAscii))) 'All Upper Case String
    End If
End Sub

Private Sub dtgBudget_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgBudget.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
 SortGrid dtgList, ColIndex, rsHeader
End Sub

'Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
'    SortGrid dtgList, ColIndex, rsHeader
'End Sub

Private Sub dtgTransRange_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

'Set Your Object
Private Sub Form_Load()
        
    Set FrmName = Me
    FormSetup
    
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'MF01'")
    
    Set rsHeader = New ADODB.Recordset
    Set rsBudget = New ADODB.Recordset
    Set rsAccountBalance = New ADODB.Recordset
    
        sSQL = "exec TrialReport '" & COID & "', '" & _
        GetValueFrTable("cValue", "SYSTEM_OPTION", "cCode = 'MTDDATEFROM'") & "', '" & _
        GetValueFrTable("cValue", "SYSTEM_OPTION", "cCode = 'MTDDATETO'") & "', 'Level 6'"
        rsAccountBalance.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly

    

    'CallComboBox Values
    Call LoadComboValues(cboCategory, "cValue", "PARAMETER_SYSTEM", "WHERE cType = 'ACCT_CAT'")
    Call LoadComboValues(cboType, "cValue", "PARAMETER_SYSTEM", "WHERE cType = 'ACCT_TYPE'")

    FormLocking True
    FormSearch True
    SearchObj True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    
    imgLogo.Picture = ITGLedgerMain.Picture1.Picture
    Mode = Find
    txtAcctNo.Locked = False
    
  
    Load_TreeView
End Sub

'Activate your Toolbar Mode
Private Sub Form_Activate()
    TBBitReload
End Sub

'Release your Object
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False

    
    
    
    
    Set rsHeader = Nothing
    Set rsBudget = Nothing
    Set rsAccountBalance = Nothing
    Set connHeader = Nothing
    Set connBudget = Nothing
    
    Set frmMaintAccount = Nothing
    
    lCloseWindow = True
    
'    'oForm(Me.Tag).Mode = 1
'    'oForm(Me.Tag).Tag = Me.Tag
End Sub

'Add new record to the recordset
Public Sub TBNew()
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtAcctNo.BackColor = &HE0FFFF
    Mode = AddNewEdit

    If rsHeader.State <> adStateOpen Then
        OpenNewConnection connHeader
        OpenNewConnection connBudget
        OpenRecordsetWithCN rsHeader, "*", "ACCOUNT", connHeader, "WHERE 1 = 0"
        OpenRecordsetWithCN rsBudget, "*", "ACCOUNT_BUDGET", connBudget, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else
        vBM = rsHeader.Bookmark
    End If

    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    rsHeader!cPCCode = sDivision

    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtAcctNo.SetFocus
    SSTab1.ActiveTab = 0
    SSTab2.ActiveTab = 0
End Sub

'Undo all changes to the recordset
Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent

    rsHeader.CancelBatch adAffectAll
    rsBudget.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM

    Set FrmName = Me
    FormLocking True

    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Else
        RSZero
        Mode = Find
    End If

    sbRS.Panels(2) = ""

    SetDataSource
    SetDataField

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo changes on the current record
Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler
    GetChild
    If rsHeader.Status = adRecNew Then
        rsHeader.CancelUpdate
        rsBudget.CancelBatch adAffectAll
    Else
        rsHeader.CancelBatch adAffectCurrent
        rsBudget.CancelBatch adAffectAll
    End If

    If rsHeader.RecordCount = 0 Then RSZero
    
ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Save all changes
Public Sub TBSave()
Dim OKUpdate As Boolean
On Error GoTo ErrHandler

    'Audit Trail
    lBoolean = False
    If rsHeader.Status = adRecNew Then lBoolean = True
    
    If Not MandatoryOK Then Exit Sub


    OKUpdate = False
    cn.BeginTrans
    connHeader.BeginTrans
    connBudget.BeginTrans
    
    rsHeader.UpdateBatch adAffectAll
    rsBudget.UpdateBatch adAffectAll


    cn.CommitTrans
    connHeader.CommitTrans
    connBudget.CommitTrans
    
    OKUpdate = True

    Set FrmName = Me
    FormLocking True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Mode = Normal


    MsgBox "Record/s successfully saved.", vbInformation, "ComUnion"

    'Audit trail
    UpdateLogFile "Account", Trim(txtAcctNo), IIf(lBoolean, "Inserted", "Updated")
    
    lblHeader = rsHeader!cAcctNo & " - " & rsHeader!cTitle & ""
    lblDetails = rsHeader!cCategory & ""
    sbRS.Panels(2) = ""

ErrHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        connHeader.RollbackTrans
        connBudget.RollbackTrans
        
        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, "ComUnion"
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        rsBudget.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, "ComUnion"
        cn.RollbackTrans
        connHeader.RollbackTrans
        connBudget.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name 'Error log
    End If
    
End Sub

'Sets the form & recorset to add/edit mode
Public Sub TBEdit()
    If IsDefaultAccount Then Exit Sub
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtAcctNo.Locked = True
    SSTab2.ActiveTab = 0
    txtTitle.SetFocus
    vBM = rsHeader.Bookmark
End Sub

'Delete record
Public Sub TBDelete()
On Error GoTo ErrorHandler

    If rsHeader.RecordCount = 0 Then Exit Sub

    If IsDefaultAccount Then Exit Sub
    
    Dim rs As New ADODB.Recordset
    Set rs = Nothing
    rs.Open "SELECT A.cAcctNo FROM VAccounts A, Account B WHERE A.cCompanyID = B.cCompanyID and A.cAcctNo = '" & Trim(txtAcctNo) & "' ", cn, adOpenStatic
    
    GetChild
    
    If rs.RecordCount <> 0 Then
        MsgBox "Unable to delete. Referenced by other transactions.", vbExclamation, "ALERT"
        rs.Close
        GoTo ErrorHandler
    End If
    If rsBudget.RecordCount <> 0 Then
        rsBudget.MoveFirst
        Do Until rsBudget.RecordCount = 0
            rsBudget.Delete adAffectCurrent
            If rsBudget.RecordCount <> 0 Then rsBudget.MoveFirst
        Loop
    End If

    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "ComUnion") = vbNo Then Exit Sub
    GetChild
    'Audit trail
    UpdateLogFile "Account", Trim(txtAcctNo), "Deleted"

    rsHeader.Delete adAffectCurrent
    rsHeader.UpdateBatch adAffectAll
    rsBudget.UpdateBatch adAffectAll
    

    TBPrevRec

    Mode = Normal

    If rsHeader.RecordCount = 0 Then
        RSZero
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        cn.Execute "DELETE ACCOUNT_BUDGET WHERE cAcctNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        Resume Next
    End If

End Sub

'Search using the frmITGSearch
Public Sub TBFind()
    Mode = Normal
    txtAcctNo.Locked = True
    frmITGSearch.Show
End Sub

'Search using the recordset primary key
Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
        
    OpenNewConnection connHeader
    OpenNewConnection connBudget
    
    Set rsHeader = Nothing
    Set rsBudget = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsBudget = New ADODB.Recordset
    
    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtAcctNo.Locked = False
        txtAcctNo.SetFocus
        Exit Sub
    End If
    
    OpenRecordsetWithCN rsHeader, "*", "ACCOUNT", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
    'OpenRecordsetWithCN rsBudget, "*", "ACCOUNT_BUDGET", connBudget
 
    OpenRecordsetWithCN rsBudget, "*", "ACCOUNT_BUDGET", connBudget, IIf(sTemp = "", "", " WHERE cAcctNo IN (SELECT cAcctNo FROM ACCOUNT WHERE " & sTemp & ")")

    Set FrmName = Me
    FormLocking True

    If rsHeader.RecordCount = 0 Then
        FormWaitHide
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        FormSearch True
        SearchObj True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtAcctNo.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    
    FormWaitHide
Else
    RSZero
    FormSearch True
    SearchObj True
    Mode = Find
    

End If

 


End Sub

'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Move first
Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader
    

End Sub

'Move previous
Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader


End Sub

'Move next
Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader
    


End Sub

'Move last
Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader
    

End Sub

'Add new line to the detail recordset
Public Sub TBNewLine()
    'Not Available
    If dtgName = "dtgBudget" Then
        rsBudget.AddNew
        rsBudget!cCompanyID = COID
        rsBudget!cAcctNo = Trim(txtAcctNo)
        GetChild
        dtgBudget.SetFocus
        dtgBudget.Col = 0
        rsBudget.MoveLast
    End If
End Sub

'Delete line in the detail recordset
Public Sub TBDeleteLine()
On Error GoTo ErrorHandler
    If dtgName = "dtgBudget" Then
        If rsBudget.RecordCount = 0 Then Exit Sub
        vBookMark = dtgBudget.Bookmark
        GetChild
        dtgBudget.Bookmark = vBookMark
        rsBudget.Delete adAffectCurrent
    End If
ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo all
Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Undo current line
Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Post current record
Public Sub TBPostRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Cancel current record
Public Sub TBCancelRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Print
Public Sub TBPrintRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Sets the data source of the controls
Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgList.DataSource = rsHeader
    Set dtgBudget.DataSource = rsBudget
    
End Sub

'Sets the data field for every bounded controls
Sub SetDataField()
    With rsHeader
        txtAcctNo.DataField = !cAcctNo
        txtTitle.DataField = !cTitle
        txtGeneral.DataField = !cGeneral
        txtLevel.DataField = !cLevel
        txtType.DataField = !cType
        txtCategory.DataField = !cCategory
        txtClass.DataField = !cClass
        
        txtDepartment.DataField = !cDepartment
        txtCenter.DataField = !cProfitCenter
        txtRefType.DataField = !cRefType
        txtReference.DataField = !cRefCode
        txtUnitDiv.DataField = !cPCCode
    End With
        
End Sub


Private Sub ReportIcon_Click()
    PopupMenu ITGLedgerMain.mnuSubReportAccounts
End Sub

Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler

    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        lblHeader = rsHeader!cAcctNo & " - " & rsHeader!cTitle & ""
        lblDetails = rsHeader!cCategory & ""
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount

        If rsHeader.Status <> adRecNew Then
            txtAcctNo.Locked = True
        Else
            txtAcctNo.Locked = False
        End If

        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else
            sbRS.Panels(2) = ""
        End If
        
        GetChild
        ShowAccountBalance
        
    Else
        lblHeader = "Account ID - Account Title"
        lblDetails = "Category"
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtAcctNo.Locked = False
    End If

    If Mode = AddNewEdit Then
        dtgBudget.Refresh
    End If

ErrorHandler:
    'Err.Number -2147217885
    'Description - Row handle referred to a deleted row or a row marked for deletion.
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab2.TabEnabled(1) = False
    Else
        SSTab2.TabEnabled(1) = True
    End If
End Sub

Private Sub txtAcctNo_LostFocus()
    'Does Code Already exists
    If Mode = AddNewEdit Then
        If Trim(txtAcctNo) = "" Then
            MsgBox "Empty primary input.", vbInformation, "ComUnion"
            If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
            txtAcctNo.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtAcctNo = Trim(txtAcctNo)
            If IDExisting(rsHeader, "cAcctNo", "ACCOUNT", Trim(rsHeader!cAcctNo)) Then
                MsgBox "Account ID already exists.", vbInformation, "ComUnion"
                If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
                txtAcctNo.SetFocus
            End If
        End If
    End If
End Sub

Private Sub txtCategory_Change()
    If Trim(txtCategory) <> "" Or txtCategory <> vbNullString Then
        cboCategory = Trim(txtCategory)
    Else
        cboCategory.ListIndex = -1
    End If
End Sub

Private Sub txtClass_Change()
    If Trim(txtClass) <> "" Or txtClass <> vbNullString Then
        cboClass = Trim(txtClass)
    Else
        cboClass.ListIndex = -1
    End If
End Sub

Private Sub txtGeneral_Change()
    If Mode = AddNewEdit Then
        txtGeneralDesc = ""
        txtGeneralDesc = GetValueFrTable("cTitle", "ACCOUNT", "cAcctNo = '" & Trim(txtGeneral) & "' AND cCategory = '" & Trim(cboCategory) & "'")
        txtLevel = CDbl(GetValueFrTable("cLevel", "ACCOUNT", "cAcctNo = '" & Trim(txtGeneral) & "' AND cCategory = '" & Trim(cboCategory) & "'")) + 1
    Else
        txtGeneralDesc = ""
        txtGeneralDesc = GetValueFrTable("cTitle", "ACCOUNT", "cAcctNo = '" & Trim(txtGeneral) & "'")
    End If
End Sub

Private Sub txtGeneral_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtGeneralDesc) = "" And Trim(txtGeneral) <> "" Then cmdPickGA_Click
End Sub

Private Sub txtType_Change()
    If Trim(txtType) <> "" Or txtType <> vbNullString Then
        cboType = Trim(txtType)
    Else
        cboType.ListIndex = -1
    End If
End Sub

'Check if all mandatory fields are complete
Function MandatoryOK() As Boolean

    MandatoryOK = True

    If Trim(txtAcctNo) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Account ID' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        txtAcctNo.SetFocus
        Exit Function
    End If
    
    If rsHeader.Status = adRecNew Then
        If IDExisting(rsHeader, "cAcctNo", "ACCOUNT", Trim(rsHeader!cAcctNo)) Then
            MandatoryOK = False
            MsgBox "Account ID already exists.", vbInformation, "ComUnion"
            txtAcctNo.SetFocus
            Exit Function
        End If
    End If

    If Trim(txtTitle) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Account Title' is mandatory. Null value is not allowed", vbInformation, "ComUnion"
        txtTitle.SetFocus
        Exit Function
    ElseIf Trim(txtCategory) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Category' is mandatory. Null value is not allowed", vbInformation, "ComUnion"
        cboCategory.SetFocus
        Exit Function
    ElseIf Trim(txtGeneral) = "" Then
        MandatoryOK = False
        MsgBox "Field 'General Account' is mandatory. Null value is not allowed", vbInformation, "ComUnion"
        txtGeneral.SetFocus
        Exit Function
    ElseIf Trim(txtType) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Type' is mandatory. Null value is not allowed", vbInformation, "ComUnion"
        cboType.SetFocus
        Exit Function
    ElseIf Trim(txtClass) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Class' is mandatory. Null value is not allowed. ", vbInformation, "ComUnion"
        Exit Function
    ElseIf Trim(txtLevel) = "0" Then
        MandatoryOK = False
        MsgBox "Field 'Level' is mandatory. Null value is not allowed. ", vbInformation, "ComUnion"
        Exit Function
    End If

End Function

'Filter detail recordset to header's primary
Private Sub GetChild()
    rsBudget.Filter = "cAcctNo = '" & Trim(rsHeader!cAcctNo) & "'"
End Sub
Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtAcctNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cAcctNo LIKE '" & Trim$(txtAcctNo.Text) & "%'"
    End If

    If Trim$(txtTitle.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cTitle LIKE '" & Trim$(txtTitle.Text) & "%'"
    End If
    
    If Trim$(txtCategory.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cCategory LIKE '" & Trim$(txtCategory.Text) & "%'"
    End If
    
    If Trim$(txtGeneral.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cGeneral LIKE '" & Trim$(txtGeneral.Text) & "%'"
    End If
    
    If Trim$(txtType.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cType LIKE '" & Trim$(txtType.Text) & "%'"
    End If
    
    If Trim$(txtDepartment.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cDepartment LIKE '" & Trim$(txtDepartment.Text) & "%'"
    End If
    
    If Trim(txtRefType.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cRefType LIKE '" & Trim$(txtRefType.Text) & "%'"
    End If
    
    If Trim(txtReference.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cRefCode LIKE '" & Trim$(txtReference.Text) & "%'"
    End If
    
    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

'Sets the form if record number is zero
Private Sub RSZero()
    lblHeader = "Account ID - Account Title"
    lblDetails = "Category"
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    
    Set dtgBudget.DataSource = Nothing
    Set FrmName = Me
    dtgBudget.Refresh
    UnbindControls
    TextClearing
    FormLocking True

    If rsHeader.State = adStateOpen Then rsHeader.Close
    If rsBudget.State = adStateOpen Then rsBudget.Close

    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True

    txtAcctNo.Locked = False
    txtAcctNo.SetFocus

    Mode = Find
End Sub

Sub SearchObj(lEnable As Boolean)
    cmdPickGA.Enabled = lEnable
    cmdPickDepartment.Enabled = lEnable
    cboType.Enabled = lEnable
    cboCategory.Enabled = lEnable
    cboRefType.Enabled = lEnable
    cmdPickRef.Enabled = lEnable
End Sub

'Default account
Private Function IsDefaultAccount() As Boolean
    IsDefaultAccount = True
    Select Case Trim(txtAcctNo)
        Case "1"
            MsgBox "General 'Asset' account. Edit/Delete of this account is not allowed.", vbExclamation + vbCritical, "ComUnion"
            Exit Function
        Case "2"
            MsgBox "General 'Liability' account. Edit/Delete of this account is not allowed.", vbExclamation + vbCritical, "ComUnion"
            Exit Function
        Case "3"
            MsgBox "General 'Capital' account. Edit/Delete of this account is not allowed.", vbExclamation + vbCritical, "ComUnion"
            Exit Function
        Case "4"
            MsgBox "General 'Revenue' account. Edit/Delete of this account is not allowed.", vbExclamation + vbCritical, "ComUnion"
            Exit Function
        Case "5"
            MsgBox "General 'Expenses' account. Edit/Delete of this account is not allowed.", vbExclamation + vbCritical, "ComUnion"
            Exit Function
        Case Else
            IsDefaultAccount = False
    End Select
End Function

Private Sub cmdPickDepartment_Click()
    If lPickListActive Then Exit Sub
    frmITGPickList.mType = SecDepartment
    frmITGPickList.Show vbModal
    'rsHeader!cDepartment = frmITGPickList.mCode
    txtDepartment.Text = frmITGPickList.mCode
    txtDepartment = frmITGPickList.mCode
    If Trim(txtDeptName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub txtDepartment_Change()
    txtDeptName = ""
    txtDeptName = GetValueFrTable("Description", "SEC_DEPARTMENT", "DeptID = '" & Trim(txtDepartment) & "'", True)
End Sub

Private Sub txtDepartment_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtDeptName) = "" And Trim(txtDepartment) <> "" Then cmdPickDepartment_Click
End Sub

Private Sub cmdPickCenter_Click()
    If lPickListActive Then Exit Sub
    frmITGPickList.mType = ProfitCenter
    frmITGPickList.Show vbModal
    rsHeader!cProfitCenter = frmITGPickList.mCode
    txtCenter = frmITGPickList.mCode
    If Trim(txtCenterName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub txtCenter_Change()
    txtCenterName = ""
    txtCenterName = GetValueFrTable("cDescription", "PROFITCENTER", "cPCCode = '" & Trim(txtCenter) & "'")
End Sub

Private Sub txtCenter_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtCenterName) = "" And Trim(txtCenter) <> "" Then cmdPickCenter_Click
End Sub

Private Sub cboRefType_Click()
    txtRefType = Trim(cboRefType)
End Sub

Private Sub cboRefType_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
    Select Case Trim(cboRefType)
        Case "Customer"
            SendKeysTab KeyAscii
        Case "Supplier"
            SendKeysTab KeyAscii
        Case "Salesman"
            SendKeysTab KeyAscii
        Case "Employee"
            SendKeysTab KeyAscii
    End Select
End Sub

Private Sub txtRefType_Change()
    If Trim(txtRefType) <> "" Or txtRefType <> vbNullString Then
        cboRefType = Trim(txtRefType)
    Else
        cboRefType.ListIndex = -1
    End If
End Sub


Private Sub cmdPickRef_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtReference)
        Select Case Trim(cboRefType)
            Case "Customer"
                frmITGPicker.zType = QCustomer
            Case "Supplier"
                frmITGPicker.zType = QSupplier
            Case "Salesman"
                frmITGPicker.zType = QSalesman
            Case "Employee"
                frmITGPicker.zType = QEmployee
        End Select
    
    frmITGPicker.Show vbModal
    txtReference = frmITGPicker.zCode
    
End Sub


Private Sub txtReference_Change()
    txtRefName = ""
    Select Case Trim(cboRefType)
        Case "Customer"
            txtRefName = GetValueFrTable("cName", "CLIENT_CUSTOMER", "cCode = '" & Trim(txtReference) & "'")
        Case "Supplier"
            txtRefName = GetValueFrTable("cName", "CLIENT_SUPPLIER", "cCode = '" & Trim(txtReference) & "'")
    End Select
    
End Sub

Private Sub txtReference_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtRefName) = "" And Trim(txtReference) <> "" Then cmdPickRef_Click
End Sub

'Show the balances of each account
'Binding of the textboxex was disabled
Private Sub ShowAccountBalance()

    rsAccountBalance.Filter = "cAcctNo = '" & Trim(rsHeader!cAcctNo) & "'"
    txtInitial = 0
    txtDebit = 0
    txtCredit = 0
    txtBalance = 0
    
    If rsAccountBalance.RecordCount <> 0 Then
        txtInitial = rsAccountBalance!nDRInitial
        txtDebit = rsAccountBalance!nDRTrans
        txtCredit = rsAccountBalance!nCRTrans
        txtBalance = rsAccountBalance!nDREnd
    End If
End Sub

'Public Sub ShowForm(sTranNo As String)
'    If Mode = Find Then
'
'        OpenNewConnection connHeader
'        OpenNewConnection connBudget
'
'        Set rsHeader = Nothing
'        Set rsBudget = Nothing
'        Set rsHeader = New ADODB.Recordset
'        Set rsBudget = New ADODB.Recordset
'
'        OpenRecordsetWithCN rsHeader, "*", "ACCOUNT", connHeader, "WHERE cAcctNo = '" & Trim(sTranNo) & "'"
'        OpenRecordsetWithCN rsBudget, "*", "ACCOUNT_BUDGET", connBudget, "WHERE cAcctNo = '" & Trim(sTranNo) & "'"
'
'        Set FrmName = Me
'        FormLocking True
'
'        If rsHeader.RecordCount = 0 Then
'            FormWaitHide
'            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
'            RSZero
'            FormSearch True
'            SearchObj True
'            Mode = Find
'            Exit Sub
'        End If
'            SetDataSource
'            SetDataField
'            txtAcctNo.BackColor = &HE0FFFF
'            Mode = Normal
'            oBar.BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True, True
'
'    End If
'
'End Sub

Private Sub txtUnitDiv_Change()
    txtUnitDivDesc = ""
    txtUnitDivDesc = GetValueFrTable("cDescription", "PROFITCENTER", "cPCCode = '" & Trim(txtUnitDiv) & "'")
End Sub

Private Sub txtUnitDiv_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtUnitDivDesc) = "" And Trim(txtUnitDiv) <> "" Then cmdPickUnitDiv_Click
End Sub

Private Sub Load_TreeView()
    Dim nodRoot As Node
    Dim newNode2 As Node

    sSQL = "SELECT * FROM Account Where cCompanyID = '" & COID & "' ORDER BY cAcctNo"

    OpenNewConnection connList
    If rs.State = adStateOpen Then rs.Close
    rs.Open sSQL, connList, adOpenKeyset

    Do Until rs.EOF
        If Trim(rs!cLevel) = "1" Then
            Set nodRoot = TreeView1.Nodes.Add(, , "AA" + rs!cAcctNo, rs!cTitle)
            With nodRoot
                .Image = "fldrClosed"
                .Expanded = False
            End With
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "2" Then
            Set newNode2 = Me.TreeView1.Nodes.Add(nodRoot, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrClosed")
            newNode2.Expanded = False
            If rs!cType = "Details" Then
                newNode2.Image = "AcctIcon"
                newNode2.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "3" Then
            Dim newnode3 As Node
            Set newnode3 = TreeView1.Nodes.Add(newNode2, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrOpen")
            newnode3.Expanded = False
            If rs!cType = "Details" Then
                newnode3.Image = "AcctIcon"
                newnode3.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "4" Then
            Dim newnode4 As Node
            Set newnode4 = TreeView1.Nodes.Add(newnode3, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrOpen")
            newnode4.Expanded = False
            If rs!cType = "Details" Then
                newnode4.Image = "AcctIcon"
                newnode4.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "5" Then
            Dim newnode5 As Node
            Set newnode5 = TreeView1.Nodes.Add(newnode4, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrOpen")
            newnode5.Expanded = False
            If rs!cType = "Details" Then
                newnode5.Image = "AcctIcon"
                newnode5.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "6" Then
            Dim newnode6 As Node
            Set newnode6 = TreeView1.Nodes.Add(newnode5, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrOpen")
            newnode6.Expanded = False
            If rs!cType = "Details" Then
                newnode6.Image = "AcctIcon"
                newnode6.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        ElseIf Trim(rs!cLevel) = "7" Then
            Dim newnode7 As Node
            Set newnode7 = TreeView1.Nodes.Add(newnode6, 4, "AA" + rs!cAcctNo, rs!cTitle, "fldrClosed", "fldrOpen")
            newnode7.Expanded = False
            If rs!cType = "Details" Then
                newnode7.Image = "AcctIcon"
                newnode7.SelectedImage = "AcctIcon"
            End If
            rs.MoveNext
        Else
            rs.MoveNext
        End If
    Loop
    
    Set rs = Nothing
    Set connList = Nothing

End Sub









